class Singleton(object):   
	objs  = {}
	def __new__(cls, *args, **kv):
		if cls in cls.objs:
			#print "info, Singleton: Object Already Exists.", str(cls)
			return cls.objs[cls]
		#print "info, Singleton: Create", str(cls)
		cls.objs[cls] = object.__new__(cls)
		if hasattr(cls, 'init_only_once'):
			cls.objs[cls].init_only_once()
		#cls.objs[cls] = super(Singleton, cls).__new__(cls)
		return cls.objs[cls]
		
if __name__ == '__main__':
	d1 = Singleton()	
	d2 = Singleton()	
	
	if(id(d1)==id(d1)):
		print "Same"
	else:
		print "Diff"